<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<isperp:problemView>
	<jsp:body>
<jsp:include page="step1view.jsp"></jsp:include>
<jsp:include page="step2view.jsp"></jsp:include>
<%-- <jsp:include page="step3view.jsp"></jsp:include> --%>
<jsp:include page="step4view.jsp"></jsp:include>
<form class="validate" id="problemForm" action="problem/problem/save"
	method="post">
	<input name="id" type="hidden" value="${model.id }">
	<div class="header">
		<h3>实施后评估</h3>
	</div>
	<table class="form-table">
		 <tr>
			<td class="td1">评审结论：</td>
			<td class="td2" colspan="3"><isperp:dictSelector
					name="assessment" selectedValue="${model.assessment }"
					hasEmptyValue="true" dictCssClass="required" id="assessment"
					typeCode="PROBLEM_ASSESSMENT"></isperp:dictSelector></td>
		</tr>
		
		<tr>
			<td class="td1">是否需要&nbsp;&nbsp;&nbsp;<br>关联知识：</td>
			<td class="td2" colspan="3">
				<select name="addKnowledge" class="required">
					<option value=""></option>
					<option value="1">是</option>
					<option value="0">否</option>
				</select>
			</td>
		</tr> 
		
		<tr>
			<td class="td1">效果评估：</td>
			<td class="td2" colspan="3"><textarea id="effectEvaluation"
					name="effectEvaluation" class="required2">${model.effectEvaluation }</textarea>

			</td>
		</tr>

	</table>
	<div class="header">
		<h3>关联流程</h3>
	</div>
	<isperp:processRelation businessKey="${detail.id }" readonly="false"
		processKey="problemProcess" projectIdControl="projectId"></isperp:processRelation>

</form>

	</jsp:body>
</isperp:problemView>

<isperp:buttonList>
	<isperp:processButtons processKey="problemProcess" formId="problemForm"
	 	beforeSubmit="function(name){return checkTask(name);}"	
		processId="${model.processId }" businessKey="${model.id }"></isperp:processButtons>
</isperp:buttonList>

<script type="text/javascript">
function checkTask(name){
	if(name=="退回"){
		var url = "problem/problem/addKnowledge?id=${model.id}";
		$.getJSON(url,function(result){
			if(result){
				return true;
			}
		});
	}
	return true;
}

/* $(function(){
	$("input[type='radio'][name='addKnowledge'][value='${model.addKnowledge}']").attr("checked",true);
}); */


</script>
